package player.ui.tree;

import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
import java.io.File;
import java.util.HashMap;

import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JTree;
import javax.swing.filechooser.FileSystemView;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.TreeCellRenderer;

import player.Tools;
import player.ui.LButton;
import player.ui.MyBasicButtonUI;

@SuppressWarnings("unused")
public class FileSystemTreeRendererVideo extends LButton implements TreeCellRenderer {
	private static final long serialVersionUID = -5000688751762857407L;
	private FileSystemView fsv=FileSystemView.getFileSystemView();

	   public FileSystemTreeRendererVideo() {
		   super();
	   }

	   public Component getTreeCellRendererComponent(JTree tree,
	         Object value, boolean sel, boolean expanded, boolean leaf,
	          int row, boolean hasFocus) {
	      if (!(value instanceof File)) {
	         return new JLabel("ss");
	      }
	      File file=(File) value;
	      this.setBorder(null);
	      this.setOpaque(false);
	      setText(fsv.getSystemDisplayName((File) value));
	      Icon icon=Tools.getFileIcon(file);
	      setIcon(icon);
	      return this;
	   }
	   
}